the user to safeguard his money that he is paying on the transaction

with a maximum limit.

2.5.12.4 Gas price

It’s the per unit price, which is calculated in Gwei. This is an ever-

fluctuating value which can be found at the https://ethgasstation.info/

website. The website gives an idea on the gas price that one needs

to spend for executing a transaction at a fast rate, i.e., <2m, or

standard rate, i.e., <5m, or low pace, i.e., <30 mins. You can use its

calculator by clicking on the Tx Calculator link in LHS to get a full

idea of how much money you are spending here.

This final transaction fee is calculated in Ether.

Gas is a very small fraction of Ether (the crypto currency associated

with Ethereum).

If we visit https://etherscan.io/txs, we can view the Gas Limit, Gas

Used by Transaction, Gas Price, and Transaction Fee in Ether.

2.5.12.5 Future of Gas

With Ethereum 2.0 working in full strength, the consensus model

would switch from the “Proof of Work” to “Proof of Stake” model.

Hence, perhaps the role of the miners would be minimal. And hence,

the gas cost might be minor or non-existing. It would be a good news

for all of us as the cost of the execution of contracts would be far

less, and hence may attract many more users in the market.

2.5.13 Storing Data in Solidity

Now that we have a good amount of knowledge on all the different

elements of a Solidity contract, it’s also time to figure out how to

write Smart Contracts following best practices, so that the code is

optimized for a minimum usage of gas and, at the same time, is not

affecting any of the functionalities adversely.

We know that the Smart contracts are compiled, deployed, and run

on the Ethereum Virtual Machine.